$(function () {
    var settings = {
        url: ctx + "socket/list",
        pageSize: 20,
        queryParams: function (params) {
            return {
                pageSize: params.limit,
                pageNum: params.offset / params.limit + 1,
                cCordUser: $("#username").val().trim()
            };
        },
        columns: [{
            checkbox: true
        },
            {
                field: 'cCordUser',
                title: '用户'
            },{
                field: "cCordSession",
                title:'会话session'
            },{
                field:"cCordType",
                title:"会话类型",
                formatter:function (value, row, index) {
                    if(value=="1"){return  "断开连接";
                    }else if(value=="2"){return "连接成功";
                    }else if(value=="3"){return "其他消息";
                    }else if(value=="4"){return  "部门消息";}
                    else if(value=="5"){return  "月报消息";}
                    else if(value=="6"){return  "个人消息";}
                    return value;
                }
            }, {
                field: 'cCordTitle',
                title: '返回消息'
            }, {
                field: 'cCordTime',
                title: '操作时间'
            }
        ]
    };
    $JuXue.initTable('log-socket-table', settings);

    var settingsPnline = {
        url: ctx + "socket/online",
        pageSize: 20,
        sidePagination:"client",
        columns: [{
            checkbox: true
        },
            {
                field: 'userid',
                title: '用户'
            },{
                field: "address",
                title:'会话地址'
            }]
    };
    $JuXue.initTable('online-socket-table', settingsPnline);
});